

#iChannel0 "file://../effects/lv_1.png"

// iResolution  已知
// iTime 已知
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 st = fragCoord/iResolution.xy;
    vec3 color = vec3(0.0);

    vec4 info = vec4(0.0);

    float s = 0.05;
    vec4 a   = texture(iChannel0,st);
    vec4 b   = texture(iChannel0,vec2(st.x + s,st.y));
    vec4 c   = texture(iChannel0,vec2(st.x + s,st.y + s));
    vec4 d   = texture(iChannel0,vec2(st.x,st.y + s));

    info =   (a  + b + c + d) / 4.0;
    info.x *= abs(sin(iTime));

    fragColor = info;

    // float waveStrength = 0.02;
    // float frequency = 30.0;
    // float waveSpeed = 5.0;
    // vec4 sunlightColor = vec4(1.0,0.91,0.75, 1.0);
    // float sunlightStrength = 5.0;
    // float centerLight = 2.;
    // float oblique = .25; 
        
    // vec2 tapPoint = vec2(iMouse.x/iResolution.x,iMouse.y/iResolution.y);
	
    // vec2 uv = fragCoord.xy / iResolution.xy;
    // float modifiedTime = iTime * waveSpeed;
    // float aspectRatio = iResolution.x/iResolution.y;
    // vec2 distVec = uv - tapPoint;
    // distVec.x *= aspectRatio;
    // float distance = length(distVec);
    
    // float multiplier = (distance < 1.0) ? ((distance-1.0)*(distance-1.0)) : 0.0;
    // float addend = (sin(frequency*distance-modifiedTime)+centerLight) * waveStrength * multiplier;
    // vec2 newTexCoord = uv + addend*oblique;    
    
    // vec4 colorToAdd = sunlightColor * sunlightStrength * addend;
    
	// fragColor = texture(iChannel0, newTexCoord) + colorToAdd;
}